package com.kinglone.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kinglone.dao.UploadMapper;
import com.kinglone.model.Upload;
import com.kinglone.service.UploadService;
import com.kinglone.util.UUIDUtils;

@Service("uploadService")
public class UploadServiceImpl implements UploadService{

	@Autowired
	private UploadMapper uploadMapper;
	@Override
	public void saveUpload(String fileName, String url, String fileType) {
		Upload u = new Upload();
		u.setSysid(UUIDUtils.getUUID());
		u.setFileName(fileName);
		u.setUrl(url);
		u.setFileType(fileType);		
		uploadMapper.saveUpload(u);
		
	}
	@Override
	public List<Upload> findAll() {
		return uploadMapper.findAll();
	}

}
